home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PASCAL / 1372.ZIP / PRINTPAS.ARC / PRINTPAS.DOC < prev    next >
Text File  |  1988-10-23  |  8KB  |  161 lines

  1.             TURBO PASCAL MODULATING PRINTING FILTER
  2.  
  3. The Turbo Pascal Printing Filter is designed to improve the readability
  4. and usefulness of printed Turbo Pascal (TP) source code. This is done
  5. by utilizing the printing commands available on most dot matrix printers
  6. commonly used with PC's. The source code file is not affected in any way,
  7. although an additional file may be created, stripped of comments, if you
  8. choose. The program may be run from a command line or you may be prompted
  9. by the program. Printing output is through the lpt1 parallel port.
  10. To properly use this printing filter (TPMPF), a few guidelines must be fol-
  11. lowed in writing source code. These guidelines will be highlighted as the
  12. operation of TPMPF is outlined below. TPMPF assumes normal pascal syntax.
  13.  
  14. Using the Command Line Input:
  15. After typing TPMPF's filename, you may list the filename to be processed
  16. with any necessary path preceeding it in dos format. If the filename excludes
  17. a period and extension, ".pas" will be assumed. Other parameters may be
  18. added as desired, separated by spaces (or tabs). To change a later parameter,
  19. the earlier ones must be listed. The parameter order is:
  20.               a)path with filename
  21.               b)printer number (default to Epson FX)
  22.               c)create comment stripped file  (default is no creation)
  23.               d)modify global var before main program  (default is yes)
  24.  
  25. Set your printer to "top of form" before starting TPMPF.
  26.  
  27. Example: prntpas b:\pascal\testprog 3
  28. TPMPF's executable filename is prntpas, it is located on drive "b" in sub-
  29. directory "pascal\". The program to print is testprog (.pas) and is to be
  30. printed with printer type #3. No comment stripped file is created and global
  31. variables are modified throughtout the source code.
  32.  
  33. Using Prompt Input:
  34. To become familiar with TPMPF, just type its filename, it will ask you
  35. for inputs, displaying values to be used on the command line when desired.
  36. Set your printer to "top of form" before entering printer type.
  37. If TPMPF can't find source code file, you will be reprompted for input.
  38.  
  39. TPMPF Operation:
  40. After getting preliminary information from the user, through a command line
  41. or by prompting, the pascal source code file is retrieved and the printer is
  42. initialized. Printing is started with a heading of the current date/time. Then
  43. the filename is printed with its directory listing of date/time.
  44. TPMPF next starts processing the code for procedure and function
  45. names, until the body of the main program begins. The comment {main program}
  46. or {MAIN PROGRAM} should be written at the "begin" of the main program.
  47. Note there is only one space between the comment brackets and that is between
  48. the two words.
  49.  
  50.     ***********INCLUDE "{MAIN PROGRAM}" or "{main program}" at***********
  51.             *********BEGIN of the MAIN PROGRAM BODY************
  52.  
  53. All procedure/function declarations must start with the upper case word
  54. "PROCEDURE" or "FUNCTION".
  55.  
  56.    *********USE "PROCEDURE" or "FUNCTION" in DECLARING THEM**********
  57.  
  58. After collecting these identifiers, the program starts from the begin-
  59. ning to print the source code, emphasizing+underlining the procedure/
  60. function names. The index number of the name will be printed as a com-
  61. ment on the right edge.It also looks for variables local to these pro-
  62. cedures/functions. The printing of these variables are modulated (us-
  63. ually italics) in the body of the procedure/function they exist in.
  64. In the declaration of them, there must be the word "var" or "Var" on
  65. a separate line (comments excepted) before any local variables are listed.
  66.  
  67.     ********DECLARE LOCAL VARIABLES WITH "Var" or "var" on a***********
  68.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  69.  
  70. Global variables must be declared with the word "VAR" on a separate line
  71. (comments excepted) before any variables are listed.
  72.  
  73.         ********DECLARE GLOBAL VARIABLES WITH "VAR" on a***********
  74.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  75.  
  76. Global variables will be printed in double strike form in the main program.
  77. If you choose, they will not be highlighted in the procedures and functions
  78. (the default is to highlight them throughout the source code).
  79.  
  80. TPMPF will keep a tally of "begin" and "end" on the right margin, looking
  81. for the words "begin", "Begin", "BEGIN", "end", "End", and "END". By tallying
  82. with "begins" adding and "ends" substracting from an index, you can more
  83. easily decipher the compound sentence logic in your code. All procedures/
  84. functions should begin/end with an index of one.
  85.  
  86.        ********USE LOWER ONLY, UPPER ONLY, or FIRST LETTER ONLY********
  87.               *******UPPER CASE for "BEGIN" and "END"********
  88.  
  89. Special case on tallying begins and ends:
  90. A few TP words have implicit "begin" and an explicit "end". Tallying is
  91. done as if both were explicit. When using the "case of" statement, both
  92. these words must be written on the same line for TPMPF to sense an implicit
  93. "begin".
  94.            *******"Case of" must appear on the same line********
  95.  
  96. After printing the source code, TPMPF will print a listing of procedures
  97. and functions detected in source code with index numbers. If the code
  98. is written with only uppercase "procedure" and "function" in declar-
  99. ations, then you can use the find-string feature of TP and the index numbers
  100. of this listing to easily move about your code while working in TP editor.
  101.  
  102. TPMPF will compress printing of comments, of type "{ }" and "(* *)".  The
  103. former will be printed at 12 or 15 cpi if your printer supports this (other-
  104. wise it will be printed at 17 cpi). The latter will be printed at 17 cpi.
  105. You may request that a source code disk file be created of your code strip-
  106. ped of one or both of these code forms. Using "(* *)" for your skipped code
  107. and "{ }" for programmer comments will enable you to conveniently strip off
  108. one and retain the other. If you have special 'in-house' comments, they
  109. may be enclosed in "(* *)" and stripped off with the code before the
  110. code is 'released'.
  111.  
  112. To clarify TPMPF's operation, a short "nonsense" pascal program is included
  113. to print using TPMPF.
  114.  
  115. Registration:
  116.  
  117. You are free to use TPMPF for up to a month before you should register.
  118. You are free to make copies and distribute it in combination with accompanying
  119. documentation.
  120.  
  121. The cost is $15 plus $1 for shipping.
  122.  
  123. By registering, you will receive:
  124.  
  125. a) The current updated version of TPMPF plus information on constructing
  126. your personalized printer command files for use by TPMPF. To help you
  127. work out command files for your printer, to produce personally tailored
  128. printing results, a test program (with source code) will be included.
  129. For convenience, you may request the default printer type be other than
  130. Epson FX.
  131.  
  132. b) A second updated version will have a default to printer type "8", for
  133. use with an external CMD file.
  134.  
  135. c) Both updated, registered versions of TPMPF will include the  provision to
  136. divert the modulated printing text to a disk file. Diverting the printing
  137. text will greatly speed up the program's operation and enable you to use
  138. "print.com" in DOS, a crude but functional 'time-share' utility. As you
  139. probably know by now, printing a long text file on a dot matrix printer can
  140. take a while. Since the running time for TPMPF is limited by how fast your
  141. printer can print output, putting the output to a disk file makes TPMPF
  142. run much faster. By using "print" in DOS, you can get your printed output
  143. of modulated source code while doing other work on your PC.
  144.  
  145. d) As a registered owner you also have the privilege of receiving program
  146. support. I can be reached at the address below or if you are connected
  147. to the "WELL" (a San Francisco bay area 'lectronic computer network),
  148. my user i.d. is "dld" (use lower case). The phone number for the WELL
  149. is (415)-332-6106.
  150.  
  151. e) As a registered owner, you may request modifications to TPMPF to meet
  152. special needs and styles. The cost for such modifications naturally depends
  153. on how much reworking is necessary. In replying to such requests, I will
  154. state the cost and time estimate for doing the modifications.
  155.  
  156. My address for registration and support is:
  157.  
  158.                  Dennis DiBart
  159.                  1820 San Benito
  160.                  Richmond, Ca. 94804
  161.